


const state = {
    isCollapse: JSON.parse(sessionStorage.getItem('isCollapse')) || false,
    
}
const getters = {
    count: state => state.count + 10
}

//mutations 执行同步操作，没有回调
const mutations = {
    SET_COLLSPSE(state) {
        state.isCollapse = !state.isCollapse;
        sessionStorage.setItem('isCollapse', JSON.stringify(state.isCollapse));
    }
}

//可以有回调处理
const actions = {
    login(content,params){
        return new Promise((resolve,reject) => {
            Login(params).then(response=>{
                resolve(response)
            }).catch(error=>{
                reject(error)
            })
        })
    }

}

export default {
    state, getters, mutations, actions
}